package com.chinaunicom.structure.composite;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/7/29 15:48
 * Description:
 */
public class Client {
    public static void main(String[] args) {
        Composite composite = new Composite("c1");
        composite.add(new Leaf("leaf1"));
        composite.add(new Composite("c2").add(new Leaf("leaf21")).add(new Leaf("leaf22")));
        composite.add(new Composite("c3").add(new Leaf("leaf31")).add(new Composite("c31").add(new Leaf("leaf41"))));


        composite.execute();
    }
}
